package buda.tabWidget;

import java.io.IOException;
import java.io.StringReader;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

public final class TwitterParser
{
	public static TwitterItem[] Parse(String xml) throws XmlPullParserException, IOException
	{
        XmlPullParserFactory factory;
			factory = XmlPullParserFactory.newInstance(
			        System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);

			factory.setNamespaceAware(true);
       XmlPullParser parser = factory.newPullParser();		
       parser.setInput(new StringReader(xml));
       
       int eventType = parser.getEventType();
       do 
       {
           if(eventType == XmlPullParser.START_DOCUMENT) 
               System.out.println("Start document");
           else if(eventType == XmlPullParser.END_DOCUMENT) 
               System.out.println("End document");
           else if(eventType == XmlPullParser.START_TAG) 
               processStartElement(parser);
           else if(eventType == XmlPullParser.END_TAG) 
               processEndElement(parser);
           else if(eventType == XmlPullParser.TEXT) 
               processText(parser);

           eventType = parser.next();
       } while (eventType != parser.END_DOCUMENT);
    	   
    	   return null;
	}

	private static void processText(XmlPullParser parser)
	{
		//parser.geta
		
	}

	private static void processEndElement(XmlPullParser parser)
	{
		// TODO Auto-generated method stub
		
	}

	private static void processStartElement(XmlPullParser parser)
	{
		// TODO Auto-generated method stub
		
	}
	
	
	
}
